import React, { Fragment } from "react"
import Header from "./common/header"
import Home from "./pages/home"
import Detail from "./pages/detail/loadable"
import Login from "./pages/login"
import Write from "./pages/write"
import { BrowserRouter, Route } from "react-router-dom"

class App extends React.Component {
  render() {
    return (
      <Fragment>
        <BrowserRouter>
          <Fragment>
            <Header />
            <Route path="/" exact component={Home} />
            <Route path="/detail/:id" exact component={Detail} />
            <Route path="/login" exact component={Login} />
            <Route path="/write" exact component={Write} />
          </Fragment>
        </BrowserRouter>
      </Fragment>
    )
  }
}

export default App
